import { Table,Tag } from 'antd'
import React from 'react'
import styles from './IconStyle.less'
import {connect} from 'react-redux'
import * as actions from '../request/action' 
class Index extends React.Component{

    constructor(props){
        super(props)
        this.state={

        }
    }
    render(){
        const pagination={
           
        }
        const data=[
            {
        
                warningTime:'2020-10-10',
            }
        ]
        const columns = [
            {
                title: "告警图片",
                dataIndex: "warningPicture",
                fixed: 'left',
                align: "center"
            },
            {
                title: "告警时间",
                dataIndex: "warningTime",
                align: "center"
            },
            {
                title: "告警类型",
                dataIndex: "warningType",
                align: "center"
            },
            {
                title: "告警地点",
                dataIndex: "warningAddress",
                align: "center"
            },
            {
                title: "状态",
                dataIndex: "status",
                align: "center",
                render: (status) => {
                    switch (status) {
                        case '疑似': return <Tag>疑似</Tag>
                        case '确认': return <Tag>确认</Tag>
                        case '误报': return <Tag>误报</Tag>
                    }
                }
            },
            {
                title: "人工甄别",
                dataIndex: "isManpower",
                align: "center",
                render: text => {
                    if (text) {
                        return <Tag color="success">是</Tag>
                    } else {
                        return <Tag color='warning'>否</Tag>
                    }
                }
            },
            {
                title: "派警",
                dataIndex: "isDistribute",
                align: "center",
                render: text => {
                    if (text) {
                        return <Tag color="success">是</Tag>
                    } else {
                        return <Tag color='warning'>否</Tag>
                    }
                }
            },
            {
                title: "反馈人",
                dataIndex: "BasicDataEntity",
                align: "center"
            },
            {
                title: "反馈时间",
                dataIndex: "distributeTime",
                align: "center"
            },
            {
                title: "反馈内容",
                dataIndex: "feedbackContent",
                align: "center"
            },
        ]
        return(
            <div className={styles.totall}>
            <Table
                className={styles.table}
                columns={columns}
                dataSource={data}
                pagination={pagination}

            />
            </div>

        )
    }
}
const mapStateToProps=(state)=>({
    Alarmdetails:state.Mapcamera.Alarmdetails
})
const mapDispatchToProps=(dispatch)=>({
    getVidiconWarning(id) {
        dispatch(actions.getVidiconWarning(id))
    }
})
export default connect(mapStateToProps,mapDispatchToProps)(Index);

    